<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="copyright" content="本页版权 www.zongheng.com 纵横中文网所有。All Rights Reserved"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="shortcut icon" href="https://static.zongheng.com/favicon.ico"/>
    <title>[[${title}]]小说_小说推荐_好看的完本免费小说推荐- 纵横中文网</title>
    <meta name="keywords" content="夕阳渐落去阅读页,第三十四章  少女情窦开"/>
    <meta name="description" content="纵横中文网最新更新夕阳渐落去,本章内容为第三十四章  少女情窦开的全文阅读页,夕阳渐落去最新章节免费阅读,页面无弹窗,访问速度快尽在纵横中文网。"/>

    <link rel="stylesheet" type="text/css" th:href="@{/css/basic.min.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/css/reader.min.css}"/>

    <link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}"/>

    <script type="text/javascript" th:src="@{/layui/layui.js}"></script>

    <script type="text/javascript" th:src="@{/js/jquery-1.9.1.js}"></script>

</head>
<body class="rb_1">
<div class="head-fixed-reader head-simple">
    <div class="wrap">
        <div class="head-top clearfix">
            <div class="logo imgbox fl">
                <a th:href="@{/index}"><img th:src="@{/picture/logo.png}" alt="logo"/></a>
            </div>
            <form id="commSearch" name="searchForm" method="get" th:action="@{/search}">
                <div style="left: 450px" class="search-box fl" data-hook="searchSuggest">
                    <label>
                        <input class="search-text fl" name="fictionName" type="text"
                               placeholder="请输入书名"/>
                    </label>
                    <input type="submit" class="search-btn fr"/>
                </div>
            </form>
            <div class="right-wrap-login ud_userTox" style="right: 0">
                <div class="unlogin ud_unlogin clearfix">
                    <div th:if="${session.loginUser==null}" class="login fl"><a class="user_login layui-icon"
                                                                                th:href="@{/login}">&#xe66f;登录</a></div>
                    <div th:if="${session.loginUser==null}" class="regist fl"><a class="user_register layui-icon"
                                                                                 th:href="@{/signin}">&#xe672;注册</a>
                    </div>
                    <div th:if="${session.loginUser==null}" class="regist fl">
                        <a style="padding-left: 12px" class="layui-icon layui-icon-template-1 "
                           th:href="@{/author/index}">作家专区</a>
                    </div>
                    <div th:if="${session.loginUser!=null}" class="shelf">
                        <a class="user_login layui-icon" th:href="@{/personal}">&#xe66f;个人中心</a>
                        <a style="padding-left: 12px;" th:href="@{/shelf}" class="layui-icon"
                           target="_blank">&#xe705;书架</a>
                        <a style="padding-left: 12px" class="layui-icon layui-icon-template-1 "
                           th:href="@{/author/index}">作家专区</a>
                        <a style="padding-left: 12px;" class="layui-icon layui-icon-rmb" th:href="@{/recharge}">充值</a>
                        <a style="padding-left: 12px;" class="layui-icon" th:href="@{/logout}">&#x1006;注销</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 大包 -->
<div class="readerPageWrap">
    <div class="h20-blank"></div>
    <!-- 推广层 -->
    <div class="goodgame">
        <a href=""></a>
    </div>
    <!-- 主内容 -->
    <div class="rw_3" id="reader_warp">
        <!-- 1.	阅读器头部推荐位 -->
        <div class="com-recbox"></div>
        <!-- 阅读页start -->
        <!-- 包裹层 -->
        <div class="rft_1">
            <!-- 内容主盒 -->
            <div class="reader_box">
                <div class="marker "></div>
                <div class="title">
                    <div class="iconbox">
                        <em class=""></em>
                    </div>
                    <div th:text="${chapter.chapterName}" class="title_txtbox"></div>
                </div>
                <div class="bookinfo">
                    更新时间：<span th:text="${#dates.format(chapter.createTime, 'yyyy-MM-dd HH:mm')}"></span>
                    <a th:href="'/chapter/list/'+${chapter.novelId}" class="reader_lnkbtn">目录</a>
                </div>

                <div class="reader_line"></div>
                <div class="content" itemprop="acticleBody">
                    <p th:utext="${chapter.chapterContent}"></p>
                    <div align="center" th:if="${chapter.chapterContent=='你还没有购买该章节! 请购买后阅读'}">
                        <button style="color: red;border-color: red;" type="button"
                                class="layui-btn layui-btn-primary layui-border-red"
                                onclick="buyVipChapter()">
                            购买章节
                        </button>
                    </div>
                </div>
                <!-- 订阅盒 -->

                <!-- 作者的话 -->

                <!-- 捧场按钮 -->

                <!-- 操作区 -->
                <div class="chap_btnbox">
                    <a th:href="'/chapter/list/'+${chapter.novelId}">目录</a>

                    <a th:href="'/chapter/read/'+${chapter.novelId}+'/'+${chapter.novelOrder-1}"
                       href="javascript:void(0)" id="pre-chapter" class="nextchapter">上一章</a>

                    <a th:href="'/chapter/read/'+${chapter.novelId}+'/'+${chapter.novelOrder+1}"
                       href="javascript:void(0)" id="next-chapter" class="nextchapter">下一章</a>
                </div>
                <input id="novelId" type="hidden" th:value="${chapter.novelId}"/>
                <input id="sort" type="hidden" th:value="${chapter.novelOrder}"/>
                <input id="chapter-id" type="hidden" th:value="${chapter.chapterId}">
                <div class="ctrl_tips">
                    按“键盘左键←”返回上一章&nbsp;&nbsp;&nbsp;按“键盘右键→”进入下一章&nbsp;&nbsp;&nbsp;按“空格键”向下滚动
                </div>

                <!-- 章评盒 -->
                <div id="reader-chapterforum-wrap" class="chapter_forum">
                    <div class="chapter_forum_tit">
                        <h3>章节评论</h3>
                        <a th:if="${session.loginUser!=null}" onclick="addCommentInfo()" class="chapter_forum_btn"
                           data-sa-d="{&quot;page_module&quot;:&quot;readPage&quot;,&quot;click_name&quot;:&quot;comment&quot;,&quot;book_id&quot;:&quot;954217&quot;}">发表章评</a>
                    </div>

                    <div class="chapter_thread_list">
                        <div class="chapter_thread">
                            <ul class="forums-list" id="JthreadList">

                            </ul>
                        </div>
                    </div>

                </div>
                <!-- /章评盒 -->

            </div>
            <!-- /内容主盒 -->
        </div>
        <!-- /包裹层 -->
    </div>
    <!-- 控制手柄 -->
    <div class="h20-blank"></div>
    <!-- /大包 -->
</div>
<script>
    document.onkeydown = function (event) {
        let e = event || window.event || arguments.callee.caller.arguments[0];
        switch (e.keyCode) {
            case 37: //左键
                window.location.href = $("#pre-chapter").attr('href');
                break;
            case 39: //右键
                window.location.href = $("#next-chapter").attr('href');
                break;
            default:
                break;
        }
    }

    //网页加载结束，自动加载评论内容
    $(function () {
        getCommentInfo();
    })

    //购买Vip章节
    function buyVipChapter() {
        let reesult = confirm("确定购买本章节吗?");
        if (reesult) {
            //获取章节id
            let chapter = $("#chapter-id").val();
            $.ajax({
                url: "/chapter/order/buy/" + chapter,
                method: "post",
                success: function (result) {
                    if (result == true) {
                        alert("购买成功,刷新即可阅读本章节");
                        //重新加载本页面
                        window.location.reload();
                    } else if (result == false) {
                        alert("购买章节失败!");
                    } else {
                        window.location.href = "/login";
                    }
                }
            })
        }
    }


    //添加评论
    function addCommentInfo() {
        layui.use('layer', function () {
            let layer = layui.layer;
            //获取小说id
            let novelId = $("#novelId").val();
            //获取章节id
            let chapterId = $("#chapter-id").val();
            //获取当前章节排序
            let sort = $("#sort").val();
            //打赏小说
            layer.open({
                type: 1,
                area: ['600px', '360px'],
                title: '评论',
                shadeClose: true, //点击遮罩关闭
                content: '<div style="padding:20px;">\n' +
                    '    <form action="/novel/comment/add" method="post">\n' +
                    '                    <input value="' + novelId + '" name="novelId" class="btn store-btn no-stored" type="hidden">\n' +
                    '                    <input value="' + chapterId + '" name="chapterId" class="btn store-btn no-stored" type="hidden">\n' +
                    '                    <input value="' + sort + '" name="sort" class="btn store-btn no-stored" type="hidden">\n' +
                    '                    <input name="content" class="btn store-btn no-stored" type="text">\n' +
                    '                    <input value="提交" class="btn store-btn no-stored" type="submit">\n' +
                    '    </form>\n' +
                    '</div>\n'
            });
        })
    }


    //获取章节评论内容
    function getCommentInfo() {
        //获取小说id
        let novelId = $("#novelId").val();
        //获取章节id
        let chapterId = $("#chapter-id").val();
        //获取页号
        let pageNum = 1;
        //发起请求获取数据
        $.ajax({
            url: "/novel/comment/query/page?pageNum=" + pageNum + "&novelId=" + novelId + "&chapterId=" + chapterId,
            method: "get",
            success: function (result) {
                if (result.message) {
                    alert(result.message);
                } else {

                    let list = result.list;

                    let html = '';

                    $(list).each(function (index, comment) {
                        html += "<li data-forumsid=\"330345\" data-threadid=\"34868259\" data-nickname=\"" + comment.userName + "\"\n" +
                            " data-userid=\"49246974\">\n" +
                            " <div class=\"user-head\"><a\n" +
                            "         target=\"_blank\"><img\n" +
                            "src='" + comment.userImg + "' \n" +
                            "            alt=\"\" width=\"50\"\n" +
                            "            height=\"50\"><span><i\n" +
                            "            class=\"star star0\"></i></span></a></div>\n" +
                            "    <div class=\"for-rp-con\">\n" +
                            "        <div class=\"name\">" + comment.userName + "</div>\n" +
                            "        <div class=\"dec clearfix hide JdecAll \"><a class=\"aLabel\"\n" +
                            "               >" + comment.commentContent + "</a>\n" +
                            "        </div>\n" +
                            "        <div class=\"other\">\n" +
                            "            <div class=\"date fl\">" + comment.createdTime + "</div>\n" +
                            "        </div>\n" +
                            "    </div>\n" +
                            "</li>";
                    });

                    //把内容回填进去
                    if (pageNum > 1) {
                        $("#JthreadList:last-child").after().html(html);
                    } else if (pageNum == 1) {
                        $("#JthreadList").html(html);
                    }

                }
            }
        })

    }

</script>
</body>
</html>
